package Thread;

import java.util.concurrent.TimeUnit;

/**
 * @author VX5
 * @Title: MJC
 * @ProjectName DataStructure
 * @Description: TODO
 * @date ${DAT}21:26
 */
public class DeadThread {
    private static Integer A = 0;
    private static Integer B = 0;


    public static void main(String[] args) {


        Thread thread1 = new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    A.wait();
                    B.wait();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        });
        Thread thread2 = new Thread(new Runnable() {
            @Override
            public void run() {
                synchronized (B){
                    synchronized (A){
                            thread1.start();
                        System.out.println("A");
                    }
                }
            }
        });
        thread2.start();
    }
}
